package com.guigui.gulimall.member.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

public class SessionConfig {

//    @Bean
//    public RedisSerializer<Object> springSessionDefaultRedisSerializer() {
//        return new FastJsonRedisSerializer<>(Object.class);
//    }
//
////    @Bean
////    public LettuceConnectionFactory connectionFactory() {
////        LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory();
////        return lettuceConnectionFactory;
////    }
//
////    @Bean
////    public WebSessionIdResolver webSessionIdResolver() {
////        CookieWebSessionIdResolver resolver = new CookieWebSessionIdResolver();
////        resolver.setCookieName("GULISESSION");
////        resolver.addCookieInitializer((builder) -> builder.path("/"));
////        resolver.addCookieInitializer((builder) -> builder.domain("gulimall.com"));
//////        resolver.addCookieInitializer((builder) -> builder.sameSite("Strict"));
////        return resolver;
////    }
//
//    @Bean
//    public CookieSerializer cookieSerializer() {
//        DefaultCookieSerializer serializer = new DefaultCookieSerializer();
//        serializer.setCookieName("GULISESSION");
//        serializer.setCookiePath("/");
//        serializer.setDomainName("gulimall.com");
////        serializer.setDomainNamePattern("^.+?\\.(\\w+\\.[a-z]+)$");
//        return serializer;
//    }
}
